import request from '@/utils/request'

// 获取WMS销售出库单
export function getSalesOutboundInfo(query) {
  return request({
    url: '/sales-outbound',
    method: 'get',
    params: query
  });
}


// 获取NCC销售出库单
export function getSalesOutboundNccInfo(query) {
  return request({
    url: '/sales-outbound/ncc',
    method: 'get',
    params: query
  });
}


//  +++废除销售出库单
export function deleteSalesOutbound(cgeneralhid, query) {
  return request({
    url: `/sales-outbound/${cgeneralhid}`,
    method: 'DELETE',
    params: query
  });
}


// 修改NCC销售出库单
export function updateSalesOutbound(cgeneralhid, data) {
  return request({
    url: `/sales-outbound/${cgeneralhid}`,
    method: 'PUT',
    data
  });
}

// 修改NCC销售出库单
export function createSalesOutboundUpdate(data) {
  return request({
    url: '/sales-outbound/update',
    method: 'post',
    data: JSON.stringify(data) // 将传入的数据转换为JSON字符串后作为请求体发送
  });
}


// 向TMS推送分好的物流信息
export function createWmsCheckLogistics(header, data) {
  return request({
    url: `/wms/check/logistic/${header}`,
    method: 'post',
    data: JSON.stringify(data) // 将传入的数据转换为JSON字符串后作为请求体发送
  });
}

// WMS系统对NCC销售出库单据进行确认
export function createSalesOutboundConfirm(data) {
  return request({
    url: '/sales-outbound/confirm',
    method: 'post',
    data: JSON.stringify(data) // 将传入的数据转换为JSON字符串后作为请求体发送
  });
}

// 销售出库取消提取
export function createSalesOutboundBack(headerid) {
  return request({
    url: `/sales-outbound/back/${headerid}`,
    method: 'post',
  });
}

// 销售出库WMS下账
export function createSalesOutboundInventory(headerid) {
  return request({
    url: `/sales-outbound/inventory/${headerid}`,
    method: 'post',
  });
}